/**
 * Created by IntelliJ IDEA.
 * User: ReZzZ
 * Date: 07 Apr 11
 * Time: 12:12:36
 * To change this template use File | Settings | File Templates.
 */
public class TrafficLight {
    private boolean HorRed = true;
    private boolean VerRed = true;
    private int situation = 1;
    /** shuffle between red and green light*/
    public void trafficShuffle(int cycle) {

        if (cycle % 3 == 0) {

            if (HorRed == true && situation == 2) {
                HorRed = false; //green light

            } else if (HorRed == false) {
                HorRed = true;
            }


            if (VerRed == true && situation == 4) {
                VerRed = false; //green light
            } else if (VerRed == false) {
                VerRed = true;

            }

            situation++;
            if (situation > 4) {
                situation = 1;

            }
        }
    }
/** return horRed value */
    public boolean getHorRed() {
        return HorRed;
    }
/** return verRed value */
    public boolean getVerRed() {
        return VerRed;
    }
}
